<?php
	$server = $_SERVER['HTTP_HOST'];
	if ($server == 'localhost') {
		define('DB_SERVER', 'localhost');
		define('DB_NAME', 'thesett');
		define('DB_USER', 'root');
		define('DB_PASS', '10137ms');
		define('DOC_ROOT', '/thesett/admin/');
		define('LOGIN', '/thesett/login');
	} else {
		define('DB_SERVER', 'sql4.cpt2.host-h.net');
		define('DB_NAME', 'thesett');
		define('DB_USER', 'thesefdwkh_1');
		define('DB_PASS', 'asV6dYR82');
		define('DOC_ROOT', '/');
		define('LOGIN', 'http://www.thesett.co.za/beta/login');
	}

	if (isset($_SESSION['user_type'])) {
	switch($_SESSION['user_type']) {
		// Admin
		case 0:
			define('NAVIGATION', serialize(
				array(
					'Dashboard',
					'Subscription',
					'Sett Credit',
					'Bookings',
					'Training',
					'Account Settings'
					)
				)
			);

			define('NAVIGATION_ICONS', serialize(
				array(
					'dashboard',
					'subscriptions',
					'invoices',
					'bookings',
					'spaces',
					'companies'
					)
				)
			);

			define('TABLES', serialize(
				array(
					'dashboard',
					'subscription',
					'settcredit',
					'bookings',
					'training_bookings',
					'settings'
					)
				)
			);

			break;

		// Companies
		case 1:
			define('NAVIGATION', serialize(
				array(
					'Dashboard',
					'Subscription',
					'Sett Credit',
					'My Users',
					'Bookings',
					'Training',
					'Account Settings'
					)
				)
			);

			define('NAVIGATION_ICONS', serialize(
				array(
					'dashboard',
					'subscriptions',
					'invoices',
					'individuals',
					'bookings',
					'spaces',
					'companies'
					)
				)
			);

			define('TABLES', serialize(
				array(
					'dashboard',
					'subscription',
					'settcredit',
					'company_users',
					'bookings',
					'training_bookings',
					'settings'
					)
				)
			);
			break;

		case 2:
			define('NAVIGATION', serialize(
				array(
					'Dashboard',
					'Subscription Types',
					'Payments &amp; Invoices',
					'Individuals',
					'Companies',
					'Buildings &amp; Spaces',
					'Training',
					'Services &amp; Equipment',
					'Bookings',
					'Logs',
					'_Subscriptions',
					'_Company Users',
					'_Spaces',
					'_Messages'
					)
				)
			);
			
			define('NAVIGATION_ICONS', serialize(
				array(
					'dashboard',
					'subscriptions',
					'invoices',
					'individuals',
					'companies',
					'spaces',
					'spaces',
					'services',
					'bookings',
					'invoices',
					'subscriptions',
					'individuals',
					'spaces',
					'messages'
					)
				)
			);

			define('TABLES', serialize(
				array(
					'dashboard',
					'subscription_types',
					'invoices',
					'users',
					'companies',
					'buildings',
					'training',
					'services',
					'bookings',
					'logs',
					'subscriptions',
					'company_users',
					'spaces',
					'alerts'
					)
				)
			);
			break;
	}
	}
?>